package com.smedi.ismedi.organization.core.domain.aggregatemodel;

import com.smedi.ismedi.organization.core.infrastructure.enumerate.HrOrganizationTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
public class HrOrganization extends BasicField implements Serializable {
    // 组织id
    private Long hrOrganizationId;

    // 组织全称
    private String fullName;

    // 组织简称
    private String shortName;

    // 组织编码
    private String organizationCode;

    // 组织类型
    private String type;

    // 组织类型含义
    private String typeMeaning;

    // 排序
    private Integer displayOrder;

    // 父节点组织id
    private Long parentId;

    // 父节点组织名称
    private String parentFullName;

    // 父节点组织简称
    private String parentShortName;

    // 根节点标记
    private boolean root;

    // 子节点组织
    private List<HrOrganization> hrOrganizationChildren = new ArrayList();

    public String getTypeMeaning() {
        return HrOrganizationTypeEnum.getName(this.type);
    }
}
